import { createApp } from 'vue'

import './style/reset.css'
import App from './App.vue'
//引入进度条
import 'nprogress/nprogress.css'
//引入element-plus
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
//引入图标
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// 引入路由配置
import router from './router'
import VueCookies from 'vue-cookies'
import Mymessage from './utils/Mymessage'
import request from './utils/Request';
import confirm from './utils/Confirm';
import bit from './utils/bit';



const app = createApp(App)
//自定义全局组件
import FolderSelect from "./components/FolderSelect.vue";
import MyTable from './components/MyTable.vue';
import MyDialog from './components/MyDialog.vue';
import Avatar from './components/MyAvatar.vue';
import MyNavigation from './components/MyNavigation.vue';
import Icon from './components/MyIcon.vue';
app.component('MyDialog', MyDialog)
app.component('MyNavigation', MyNavigation)
app.component('MyAvatar', Avatar)
app.component('MyTable', MyTable)
app.component('FolderSelect', FolderSelect)
app.component('Icon', Icon)
app.use(router)
app.use(ElementPlus)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

//全局组件
app.config.globalProperties.request = request
app.config.globalProperties.confirm = confirm
app.config.globalProperties.Mymessage = Mymessage
app.config.globalProperties.bit = bit
app.config.globalProperties.VueCookies = VueCookies
app.config.globalProperties.globalInfo = {
  avatarUrl:"/api/getAvatar",
  imageUrl:"/api/file/getImage/"
}
app.mount('#app')

